Shader "Custom/Cell" {
	Properties {
		_MainTex ("Base (RGB)", 2D) = "white" {}
	}
	SubShader {
		Tags { "RenderType"="Opaque" }
		LOD 200
		
		CGPROGRAM
		#pragma surface surf SimpleLambert

		sampler2D _MainTex;

		struct Input {
			float2 uv_MainTex;
		};
		
		float4 LightingSimpleLambert(SurfaceOutput s,half3 lightDir,half atten){
			half NdotL = dot(s.Normal,lightDir);
			NdotL = (NdotL + 1.0) * 0.5;
			float4 c = tex2D(_MainTex,float2(NdotL,NdotL));
			return c;
		}

		void surf (Input IN, inout SurfaceOutput o) {
			half4 c = tex2D (_MainTex, IN.uv_MainTex);
			o.Albedo = c.rgb;
			o.Alpha = c.a;
		}
		ENDCG
	} 
	FallBack "Diffuse"
}
